
# ====  后台管理路由 =====   

from django.conf.urls import url
from . views import IndexViews,UserViews,TypesViews,GoodsViews,OrderViews


urlpatterns = [
    
    # 后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),
    # 登录页面
    url(r'^login/$', IndexViews.adminlogin,name='myadmin_login'),
    # 退出登录
    url(r'^logout/$', IndexViews.adminlogout,name='myadmin_logout'),
    # 验证码请求的路由
    url(r'^vcode/$', IndexViews.verifycode,name='myadmin_vcode'),


    # 会员管理
    # 添加会员
    url(r'^user/add/$', UserViews.add,name='myadmin_user_add'),
    # 执行添加会员
    url(r'^user/insert/$', UserViews.insert,name='myadmin_user_insert'),
    # 会员列表
    url(r'^user/list/$', UserViews.list,name='myadmin_user_list'),
    # 删除会员
    url(r'^user/delete/$',UserViews.delete,name='myadmin_user_delete'),
    # 编辑会员
    url(r'^user/edit/(?P<uid>[0-9]+)/$', UserViews.edit,name='myadmin_user_edit'),
    # 执行更新会员
    url(r'^user/update/$',UserViews.update,name='myadmin_user_update'),


    # 分类管理
    # 添加分类
    url(r'^types/add/$', TypesViews.add,name='myadmin_types_add'),
    # 执行添加分类
    url(r'^types/insert/$', TypesViews.insert,name='myadmin_types_insert'),
    # 分类列表
    url(r'^types/list/$', TypesViews.list,name='myadmin_types_list'),
    # 删除分类
    url(r'^types/delete/$',TypesViews.delete,name='myadmin_types_delete'),
    # 编辑分类
    # url(r'^types/edit/(?P<tid>[0-9]+)/$', TypesViews.edit,name='myadmin_types_edit'),
    # 执行更新分类
    url(r'^types/update/$',TypesViews.update,name='myadmin_types_update'),


    # 商品管理
    # 添加会员
    url(r'^goods/add/$', GoodsViews.add,name='myadmin_goods_add'),
    # 执行添加会员
    url(r'^goods/insert/$', GoodsViews.insert,name='myadmin_goods_insert'),
    # 会员列表
    url(r'^goods/list/$', GoodsViews.list,name='myadmin_goods_list'),
    # 删除会员
    url(r'^goods/delete/$',GoodsViews.delete,name='myadmin_goods_delete'),
    # 编辑会员
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', GoodsViews.edit,name='myadmin_goods_edit'),
    # 执行更新会员
    url(r'^goods/update/$',GoodsViews.update,name='myadmin_goods_update'),


    # 订单管理
    url(r'^order/$',OrderViews.index,name='myadmin_order_index'),
    url(r'^order/fahuo/$',OrderViews.fahuo,name='myadmin_order_fahuo'),



    # 管理员列表路由
    url(r'^auth/user/$', IndexViews.authuser,name='myadmin_authuser'),
    # 管理员添加
    url(r'^authuser/add/$', IndexViews.authuseradd,name='myadmin_authuseradd'),
    # 授权组列表路由
    url(r'^auth/group/$', IndexViews.authgroup,name='myadmin_authgroup'),
    url(r'^authgroup/add/$', IndexViews.authgroupadd,name='myadmin_authgroupadd'),
    url(r'^authgroup/edit/(?P<gid>[0-9]+)/$', IndexViews.authgroupedit,name='myadmin_authgroup_edit'),

    # 缓存实验
    url(r'^cache/one/$',IndexViews.one),
    url(r'^cache/two/$',IndexViews.two),
]
